#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int bin_search(int arr[], int left, int right,int key)
{
	int flag = 0;
	int mid = 0;
	while (left <= right)
	{
		mid = (left + right) / 2;
		if (arr[mid] > key)//1 2 3 4 5 6 7 8 9     2
		{
			right = mid - 1;
		}
		else if (arr[mid] < key)
		{
			left = mid + 1;
		}
		else
		{
			flag = 1;
			break;
		}
	}
	if (flag == 1)
	{
		return mid;
	}
	else
	{
		return -1;
	}
}

int main()
{
	int arr[] = { 1,2,3,4,5,6,7,8,9,10 };
	int left = 0;
	int right = sizeof(arr) / sizeof(int);
	int key;
	scanf("%d", &key);
	printf("%d", bin_search(arr,left,right,key));
	return 0;
}